import java.util.Arrays;

public class Demo11 {
    public static void main(String[] args) {
        int[] num = { 1, 3, 2, 5, 6, 4 };
        Arrays.sort(num);
        System.out.println(Arrays.toString(num));

        int[][] ns = {
                { 1, 2, 3 },
                { 4, 5, 6 }
        };
        System.out.println(Arrays.deepToString(ns));

        /*
         * 使用二维数组可以表示一组学生的各科成绩，请计算所有学生的平均分：
         */
        int[][] scores = {
                { 82, 90, 91 },
                { 68, 72, 64 },
                { 95, 91, 89 },
                { 67, 52, 60 },
                { 79, 81, 85 },
        };
        double average = 0;
        double scoresSum = 0;
        for (int[] i : scores) {
            for (int j : i) {
                scoresSum = scoresSum + j;
            }
        }
        average = (scoresSum / scores.length) / scores[0].length;
        System.out.println(average);
        System.out.println(average);
        if (Math.abs(average - 77.733333) < 0.000001) {
            System.out.println("测试成功");
        } else {
            System.out.println("测试失败");
        }
    }
}
